<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>login</title>
<link rel="stylesheet" type="text/css" href="../../css/index.css" />

<style media="screen">
	html,body{background: #f5f5f5;}

	.info-box{box-sizing: border-box;width: 100%;flex-direction: column;position: fixed;top: 0;left: 0;right: 0;bottom: 0;}
	.info-one{height: 50px;align-items:center;flex-shrink: 0;overflow: hidden;width: 100%;background: #ffffff;padding: 0 15px;box-sizing: border-box;}
	.info-one .input-box{overflow: hidden;}
	.info-one input{padding: 10px;box-sizing: border-box;width: 100%;color: #333333;}
	.info-one .code{width: 74px;height: 28px;background: #ffffff;text-align: center;line-height: 28px;font-size: 12px;color: #FF9502;flex-shrink: 0;border: 1px solid #FF9502;border-radius: 4px;box-sizing: border-box;}
	.info-one .lf{line-height: 50px;width: 60px;flex-shrink: 0;}
	.login-btn{height:45px;flex-shrink: 0;background:#FF9502;border-radius:4px;text-align: center;line-height: 45px;color: #FFFFFF;font-size: 18px;margin: 60px 15px;}

	/*协议*/
	.xieyi{font-size: 13px;color:#999999;line-height: 30px;padding: 15px ;box-sizing: border-box;align-items: center;}
	.xieyi .sel-box{width: 16px;height: 16px;background: url(../../image/login/sel_0.png) no-repeat left center;background-size:16px;margin-right: 10px;}
	.xieyi .sel-box.on{background: url(../../image/login/sel_1.png) no-repeat left center;background-size:16px;}
	.xieyi span{color: #333333;}

</style>
</head>
<body>
	<div id="vue">

		<div class="info-box flex">

			<div class="info-one flex border-bottom">
				<div class="lf">手机号</div>
				<div class="flex1 input-box">
					<input type="text" name="phone" id="phone" readonly="readonly" :value="udata.phone_hide">
				</div>
			</div>
			<div class="info-one flex">
				<div class="lf">验证码</div>
				<div class="flex1 input-box">
					<input type="tel" maxlength="6" name="code" id="code" placeholder="请输入您的验证码">
				</div>
				<div class="code" tapmode onclick="getCodeClick(this)">获取验证码</div>
			</div>

			<!--同意协议-->
			<div class="xieyi flex">
				<div :class="['sel-box flex',seLxy ? 'on' : '']" tapmode onclick="seLxieyi(this)"></div>
				我已阅读并知晓了<span data-url="main3/fuwenben.html" data-type="Page/zhcancel" data-title="平台用户注销协议" tapmode onclick="open_page(this)">《平台用户注销协议》</span>
			</div>

			<div class="login-btn" tapmode onclick="ok()">确定</div>
		</div>

	</div>
</body>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">

	define(function (require, exports, module) {

		setData = function () {
			var udata = lanYun.getUdata();
			//console.log(JSON.stringify(udata));
			lanYun.vue.udata = udata;
		};

		lanYun.newVue('#vue',{
			udata:{},
			seLxy:1,
		},function() {

		});

		setData();

		//下一步
		ok = function (){
			var data = {};
			data.code = $('#code').val();
			if(!data.code) {
				lanYun.toast('请输入短信验证码');
				return;
			}
			if(!lanYun.vue.seLxy){
				lanYun.toast('请阅读用户注销协议');
				return;
			}
			lanYun.post('user/zhcancel', data ,function (ret) {
				//console.log(JSON.stringify(ret));
	            if(ret.errcode == 0){
	                lanYun.toast(ret.msg);
					clearTimeout(lanYun.timeout);
					lanYun.openFrame('main3/msg_pinjia.html',{type:"zhuxiao",ani:1},function(){});
	            }else{
	                lanYun.toast(ret.msg);
	            }
	        },2);
		}


		//获取验证码
		getCodeClick = function (tis) {
			if($(tis).hasClass('on')){
				return;
			}
			var data = {type : 'zhcancel'};
			data.phone = lanYun.vue.udata.phone;
			lanYun.post('send/getcode', data ,function (ret) {
				if(ret.errcode == 0){
					lanYun.toast(ret.msg);
					lanYun.setWait(tis);
				}else{
					lanYun.toast(ret.msg);
				}
			},2);
		};

		//打开协议
		open_page = function (tis) {
			var dst = tis.dataset;
			lanYun.openWin(dst.url, {
				win:'win',
				title:dst.title,
				frameParam : dst
		   });
		}

		//同意协议
		seLxieyi = function(){
			var seLxy = lanYun.vue.seLxy;
			lanYun.vue.seLxy = seLxy ? 0 : 1;
		}

		// closewin = function () {
		// 	lanYun.loginOut(1);
        //     lanYun.event('toIndex');
		// }

	});

</script>
</html>
